package main

import (
	"fmt"
	"time"
	"yundian/internel/app/helper/request"
	"yundian/internel/app/logic"
	"yundian/internel/pkg/dbs"
	"yundian/internel/pkg/dingo"
)

func main() {
	//dingo.InitViper("./configs/zmtest.yaml")
	dingo.InitViper("./configs/adm.yaml")
	dbs.NewMysqlComponent().Step()
	dbs.NewRedisComponent().Step()

	//logic.NewTaskLogic().AutoTradePayByMonth()

	AppId := "2021003125629284"
	param := &request.AliPayAutoTradeCreate{
		AgreementNo: "20225131820158051664", // 签约号
		Openid:      "2088022768301641",     // 用户ID
	}
	h, _ := time.ParseDuration("24h")
	aliPayOrderLogic := logic.NewAliPayOrderLogicAppid(AppId, "")
	param.RenewTime = time.Now().Add(h).Format("2006-01-02")
	respModifyData, err := aliPayOrderLogic.AliPayAutoExecModify(param)
	fmt.Println("AliPayAutoExecModify", respModifyData.Response.Msg, err)
}
